import './App.css';
import { loadMicroApp } from 'qiankun';
function App() {
  const loadApp = type => {
    const loadMap = {
      react: {
        name: 'qiankun-react-starter',
        entry: 'http://localhost:3001',
        container: '#container',
        activeRule: '/qiankun-react-starter',
      },
      vue: {
        name: 'qiankun-vue-starter',
        entry: 'http://localhost:8080',
        container: '#container',
        activeRule: '/qiankun-vue-starter',
      },
    };
    loadMicroApp(loadMap[type]);
  };
  return (
    <div className="App">
      <button onClick={() => loadApp('react')}>手动加载（react）</button>
      <button onClick={() => loadApp('vue')}>手动加载（vue）</button>
      <div id="container" className="container"></div>
    </div>
  );
}

export default App;
